from dataclasses import dataclass


@dataclass
class AuthenticatedUser:
    user_id: int
    team_id: int | None
    auth_method: str
    scopes: list[str] | None = None


def has_required_scope(scopes: list[str], required: str = "task:write") -> bool:
    if not scopes:
        return False
    return "*" in scopes or required in scopes
